<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html">
     <f:view>

         <h:head>
         <link href="styles.css" rel="stylesheet" type="text/css"/>
         <title>
            <h:outputText value="#{msgs.pageTitleped}"/>
         </title>
      </h:head>
         <h:body>
         <h:form>
           <table>
               <tr>
                  <td>
                     <h:outputText value="#{msgs.code}"/>
                  </td>
                  <td>
                     <h:inputText value="#{pedido.codigo}" required="true"/>
                  </td>
               </tr>
                <tr>
                  <td>
                      <h:outputText value="#{msgs.description}"/>
                  </td>
                  <td>
                      <h:inputText value="#{pedido.descricao}" required="true"/>
                  </td>
               </tr>
                 <tr>
                  <td>
                      <h:outputText value="#{msgs.date}"/>
                  </td>
                  <td>
                      <h:inputText value="#{pedido.dataPedido}" required="true">
                          <f:convertDateTime pattern="dd/MM/yyyy" timeZone="GMT-3"/>
                      </h:inputText>
                  </td>
               </tr>
                 <tr>
                 <td>
                      <h:outputText value="#{msgs.autoHeader}"/>
                  </td>
                  <td>
                      <h:selectOneMenu id="automovel" value="#{pedido.automovel}" required="true">
                          <f:converter converterId="autoConverter" />
                          <f:selectItems value="#{ctrAutomovel.automoveis}" var="automoveis" itemLabel="#{automovel.marca}" itemValue="#{automovel.id}"/>
                    </h:selectOneMenu>
                  </td>
               </tr>
                  <tr>
                 <td>
                      <h:outputText value="#{msgs.cliHeader}"/>
                  </td>
                  <td>
                      <h:selectOneMenu id="cliente" value="#{pedido.cliente}" required="true">
                          <f:converter converterId="cliConverter" />
                          <f:selectItems value="#{ctrCliente.clientes}" var="clientes" itemLabel="#{cliente.nome}" itemValue="#{cliente.id}"/>
                    </h:selectOneMenu>
                  </td>
               </tr>
                 <tr>
                 <td>
                      <h:outputText value="#{msgs.funcHeader}"/>
                  </td>
                  <td>
                      <h:selectOneMenu id="funcionario" value="#{pedido.funcionario}" required="true">
                          <f:converter converterId="funcConverter" />
                          <f:selectItems value="#{ctrFuncionario.funcionarios}" var="funcionarios" itemLabel="#{funcionario.nome}" itemValue="#{funcionario.id}"/>
                    </h:selectOneMenu>
                  </td>
               </tr>

                
               </table>
             <h:commandButton value="Incluir" action="#{ctrPedido.salvar}">
                 <f:setPropertyActionListener value="#{pedido}" target="#{ctrPedido.pedido}" />
             </h:commandButton>
         </h:form>
      </h:body>
   </f:view>
</html>
